<h2 class="contentTitle">添加/修改供应商</h2>
<style>
    .pageFormContent dl dt {
        width: 100px;
    }
    .pageFormContent dl dd {
        width: 220px;
    }
</style>
<div class="pageContent">
    {if $action_name=='add'}
    <form id="myform" method="post" action="{:U($module_name.'/insert')}" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone);">
    {else}
    <form id="myform" method="post" action="{:U($module_name.'/update')}" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone);">
        {if $info['id']}<input type="hidden" name="id" value="{$info['id']}" />{/if}
	{/if}
        <div class="pageFormContent nowrap" layoutH="97">
            <dl>
                <dt>供应商名称：</dt>
                <dd><input type="text" name="name" maxlength="20" class="required" style="float: none;" data-validate="validate(required);" {if !$info['name']}
 remote="{:U($module_name.'/field_exist',array('tn'=>'ProductSuppliers','fn'=>'name'))}"{/if}
 placeholder="请输入供应商名称" value="{$info['name']}"/></dd>
            </dl>
            <dl>
                <dt>邮箱：</dt>
                <dd><input type="text" name="email" placeholder="请输入邮箱" value="{$info['email']}" style="float: none;"  ></dd>
            </dl>
            <dl>
                <dt>地址：</dt>
                <dd><input type="text" name="address" placeholder="请输入地址" value="{$info['address']}" style="float: none;" /></dd>
            </dl>
            <dl>
                <dt>电话：</dt>
                <dd><input type="text" name="telephone" placeholder="请输入手机" value="{$info['telephone']}" style="float: none;" /></dd>
            </dl>
            <dl>
                <dt>传真：</dt>
                <dd><input type="text" name="fax" placeholder="请输入传真" value="{$info['fax']}"/></dd>
            </dl>
            <dl>
                <dt>联系人：</dt>
                <dd><input type="text" name="contact" placeholder="请输入联系" value="{$info['contact']}" style="float: none;" /></dd>
            </dl>
            <dl>
                <dt>编号：</dt>
                <dd><input type="text" name="iden" placeholder="请输入编号" value="{$info['iden']}" style="float: none;" /></dd>
            </dl>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="submit">
                                保存
                            </button>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" class="close">
                                取消
                            </button>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
    </form>
</div>

<script>
    $(function(){
        $.ketchup.createErrorContainer(function(form, el) {
            return $('<ul/>', {
                    'class': 'ketchup-custom'
                    }).insertAfter(el);
        }).addErrorMessages(function(form, el, container, messages) {
            container.html('');

            for(i = 0; i < messages.length; i++) {
            $('<li/>', {
                text: messages[i]
            }).appendTo(container);
            }
        }).showErrorContainer(function(form, el, container) {
            container.slideDown('fast');
        }).hideErrorContainer(function(form, el, container) {
            container.slideUp('fast');
        });

        $('#myform').ketchup({
            validateEvents: 'blur keyup'
        });    
    })
</script>